const path = require("path")
function resolve (dir) {
  return path.join(__dirname, dir)
}
console.log(process.env.foo);
console.log(process.env.VUE_APP_DONG);
module.exports = {
  // publicPath: '/base',
  // configureWebpack: {
  //   resolve: {
  //     alias: {
  //       comps: path.resolve(__dirname, 'src/components')
  //     }
  //   }
  // },
  configureWebpack(config) {
    config.resolve.alias.comp = path.join(__dirname, 'src/components')
    if(process.env.NODE_ENV === 'development') {
      config.name = 'vue测试'
    }else {
      config.name = "vue正式"
    }
  },
  chainWebpack(config) {
    config.module.rule('svg')
      .exclude.add(resolve('src/assets/icon'))
    config.module.rule('icons')//vue inspect --rule icons 查看配置
      .test(/\.svg$/)
      .include.add(resolve('src/assets/icon')).end()
      .use('svg-sprite-loader')
      .loader('svg-sprite-loader')
      .options({symbolId: 'icon-[name]'}) //#icon-weixin
  }
}